/* 
 *  <copyright file="IActor.cs" company="Wesley Jowitt">
 *  
 *  SobrietyEngine: Copyright (c) 2011 Wesley Jowitt
 *  
 *  This software is distributed under a software license.
 *   * As of the creation time of this file, the license in use is the Microsoft Permissive License (Ms-PL) 
 *    * The license can be viewed at:
 *     * License.Txt in the root folder of this project
 *      * http://sobrietyengine.codeplex.com/license
 *       * http://www.microsoft.com/opensource/licenses.mspx
 *       
 *  </copyright>
 *   */

using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using SobrietyEngine.Events;
using SobrietyEngine.Guids;
using SobrietyEngine.Scene;

namespace SobrietyEngine.Actor
{
    /// <summary>
    /// Interface fo actor objects
    /// </summary>
    /// <remarks>
    /// Interface for actor objects
    /// </remarks>
    public interface IActor
    {
        /// <summary>
        /// Gets or sets a value indicating whether [marked for removal].
        /// Removes actor on next update
        /// </summary>
        /// <value>
        ///   <c>true</c> if [marked for removal]; otherwise, <c>false</c>.
        /// </value>
        Boolean MarkedForRemoval { get;set;}

        IEventRouter EventRouter { get; }

        /// <summary>
        /// Gets the gameServices.
        /// </summary>
        /// <returns></returns>
        SobrietyEngine.Games.ISobrietyGameServices GameServices();

        /// <summary>
        /// Gets the GUID.
        /// </summary>
        /// <returns></returns>
        //CGuid GetGuid();
        CGuid Guid { get; }

        Game Game { get; }

        /// <summary>
        /// Attaches the component.
        /// </summary>
        /// <param name="component">The component.</param>
        void AttachComponent(SobrietyEngine.Components.IComponent component);

        /// <summary>
        /// Removes the component.
        /// </summary>
        /// <param name="comp">The comp.</param>
        void RemoveComponent(SobrietyEngine.Components.IComponent comp);

        /// <summary>
        /// Updates the specified elapsed timeInMs.
        /// </summary>
        /// <param name="ElapsedTime">The elapsed timeInMs.</param>
        void Update(GameTime ElapsedTime);

        /// <summary>
        /// Initializes this args.
        /// </summary>
        void Initialize();

        /// <summary>
        /// Removes this args.
        /// </summary>
        void Remove();

        /// <summary>
        /// Gets the components.
        /// </summary>
        /// <returns></returns>
        Dictionary<Type, List<SobrietyEngine.Components.IComponent>> GetComponents();

        /// <summary>
        /// Queries for the specified strType.
        /// </summary>
        /// <param name="strType">The strType.</param>
        /// <returns></returns>
        SobrietyEngine.Components.IComponent Query(Type type);
        List<SobrietyEngine.Components.IComponent> QueryList(Type type);


        /// <summary>
        /// Gets the comp without casting crap fo lazy typers
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        T Get<T>();

        void UnregisterEventListeners();
        void RegisterEventListeners();

        Boolean UpdateActor { get; set; }


        IScene Scene { get; }

        string ToString();
    }
}
